package com.sui.bigdata.sml.web.util;

/**
 * @author songhaicheng
 * @date 2020/1/14 16:10
 * @description
 * @reviewer
 */
public enum ModelType {
    /**
     * 无效的格式
     */
    INVALID(""),
    /**
     * SPARK
     */
    SPARK("spark"),
    /**
     * PMML
     */
    PMML("pmml"),
    /**
     * MLEAP
     */
    MLEAP("mleap"),
    /**
     * TENSROFLOW
     */
    TF("tensorflow");

    private String value;

    ModelType(String value) {
        this.value = value;
    }

    public String getValue() {
        return this.value;
    }

    public static ModelType getType(String candidate) {
        for (ModelType type : values()) {
            if (type.getValue().equals(candidate.toLowerCase())) {
                return type;
            }
        }
        return INVALID;
    }
}
